﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using YArchitech.Revit;

namespace YArchitech.HVAC
{
	public class DuctTerminalHorizontalSelectionFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			if (!(elem is FamilyInstance))
			{
				return false;
			}
			if (elem.Category.Id.IntegerValue != -2008013)
			{
				return false;
			}
			XYZ basisZ = YJKRevitTools.GetElementConnector((Domain)1, elem).CoordinateSystem.BasisZ;
			return basisZ.X == 0.0 && basisZ.Y == 0.0 && basisZ.Z != 0.0;
		}

		public bool AllowReference(Reference reference, XYZ position)
		{
			return false;
		}
	}
}
